<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>财富管家X-管理员</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" th:href="@{images/littlelogo.png}" >
    <link rel="icon" th:href="@{/favicon.ico}"  mce_href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
    <link rel="stylesheet" th:href="@{/css/modules/layer/default/layer.css}">
    <script type="text/javascript" th:src="@{/lib/layui/layui.js}" ></script>
   <!-- <script type="text/javascript" th:src="@{/js/layer.js}"></script>-->
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>

</head>
<body>
    <!-- 顶部开始 -->
    <div class="container">
        <div class="logo"><a th:href="@{/admin/index}">X-admin 财富管家</a></div>
        <div class="left_open">
            <i title="展开左侧栏" class="iconfont">&#xe699;</i>
        </div>
        <!--<ul class="layui-nav left fast-add" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">+新增</a>
            <dl class="layui-nav-child"> &lt;!&ndash; 二级菜单 &ndash;&gt;
              <dd><a onclick="x_admin_show('资讯','http://www.baidu.com')"><i class="iconfont">&#xe6a2;</i>资讯</a></dd>
              <dd><a onclick="x_admin_show('图片','http://www.baidu.com')"><i class="iconfont">&#xe6a8;</i>图片</a></dd>
               <dd><a onclick="x_admin_show('用户','http://www.baidu.com')"><i class="iconfont">&#xe6b8;</i>用户</a></dd>
            </dl>
          </li>
        </ul>-->
        <ul class="layui-nav right" lay-filter="">
          <li class="layui-nav-item">
            <a href="javascript:;">admin</a>
            <dl class="layui-nav-child"> <!-- 二级菜单 -->
              <!--<dd><a onclick="x_admin_show('个人信息','http://www.baidu.com')">个人信息</a></dd>
              <dd><a onclick="x_admin_show('切换帐号','http://www.baidu.com')">切换帐号</a></dd>-->
              <dd><a th:href="@{/admin/login}">退出</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item to-index"><a onclick="qt()" >前台首页</a></li>
        </ul>
        
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
     <!-- 左侧菜单开始 -->
    <div class="left-nav">
      <div id="side-nav">
        <ul id="nav">
            <li>
                <a href="javascript:;">
                    <i class="iconfont">&#xe6b8;</i>
                    <cite>用户管理</cite>
                    <i class="iconfont nav_right">&#xe697;</i>
                </a>
                <ul class="sub-menu">
                    <li>
                        <a _href="/cfgjht/user/list">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>用户权限</cite>
                            
                        </a>
                    </li >
                    <li>
                        <a _href="/cfgjht/user/userlist">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>用户实名</cite>
                        </a>
                    </li >
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="iconfont">&#xe723;</i>
                    <cite>公告管理</cite>
                    <i class="iconfont nav_right">&#xe697;</i>
                </a>
                <ul class="sub-menu">
                    <li>
                        <a _href="/cfgjht/gg/gg-list">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>公告列表</cite>
                        </a>
                    </li >
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="iconfont">&#xe723;</i>
                    <cite>项目管理</cite>
                    <i class="iconfont nav_right">&#xe697;</i>
                </a>
                <ul class="sub-menu">
                    <li>
                        <a _href="/cfgjht/home/project_examine">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>项目审核</cite>
                        </a>
                    </li >
                    <li>
                        <a _href="/cfgjht/home/project_loan">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>借款中项目列表</cite>
                        </a>
                    </li >
                    <li>
                        <a _href="/cfgjht/home/project_Repayments">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>还款中项目列表</cite>
                        </a>
                    </li >
                    <li>
                        <a _href="/cfgjht/home/project_completion">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>已完成项目列表</cite>
                        </a>
                    </li >
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    <i class="iconfont">&#xe723;</i>
                    <cite>众筹管理</cite>
                    <i class="iconfont nav_right">&#xe697;</i>
                </a>
                <ul class="sub-menu">
                    <li>
                        <a _href="/cfgjht/crowdfunding/firstList">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>众筹审核</cite>
                        </a>
                    </li >
                    <li>
                        <a _href="/cfgjht/crowdfunding/crowdfunding_list">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>众筹列表</cite>
                        </a>
                    </li >
                </ul>
            </li>

        </ul>
      </div>
    </div>
    <!-- <div class="x-slide_left"></div> -->
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
          <ul class="layui-tab-title">
            <li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <!--<iframe th:src='@{/admin/welcome.html}' frameborder="0" scrolling="yes" class="x-iframe">--></iframe>
                <iframe th:replace="admin/welcome::html" frameborder="0" scrolling="yes" class="x-iframe"></iframe>
            </div>
          </div>
        </div>
    </div>
    <div class="page-content-bg" ></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
<div class="footer">
        <div class="copyright">Copyright ©2017 版权归全民科技有限公司所有-盗版必究</div>
    </div>
</body>
<script >
    function qt() {
        window.location.href="http://localhost:9000/cms/login";
    }
</script>
<script>
    var websocket = null;
    function send1() {
        console.log(1)
    }

    //判断当前浏览器是否支持WebSocket
    if('WebSocket' in window){
        websocket = new WebSocket("ws://localhost:9001/cfgjht/websocket/1");
    }
    else{
        alert('Not support websocket')
    }



    //连接发生错误的回调方法
    websocket.onerror = function(){
        setMessageInnerHTML("error");
    };

    //连接成功建立的回调方法
    websocket.onopen = function(event){

        setMessageInnerHTML("open");
    }
    /* $(function(){

         setInterval(function(){
             send1()
         }, 1000);
     });
 */
    //接收到消息的回调方法
    websocket.onmessage = function(event){
        console.log(event.data=="ok")
        setMessageInnerHTML(event.data);

        layer.open({
            type: 2,
            title:['新消息~~~ ','font-size:14px;color:orange;text-align:center;height:20px;line-height: 19px;'],
            skin: 'layui-layer-rim'//加上边框
            ,area: ['330px', '80px']
            ,shade: 0
            ,anim:2
            ,offset: 'rb'
            ,content: '/cfgjht/getMsg'
            ,zIndex: layer.zIndex //重点1
            ,success: function(layero){
                layer.setTop(layero); //重点2
            }
        });
    }


    //连接关闭的回调方法
    websocket.onclose = function(){
        setMessageInnerHTML("close");
    }

    //监听窗口关闭事件，当窗口关闭时，主动去关闭websocket连接，防止连接还没断开就关闭窗口，server端会抛异常。
    window.onbeforeunload = function(){
        websocket.close();
    }

    //将消息显示在网页上
    function setMessageInnerHTML(innerHTML){

        /* var xxx = innerHTML;
        layui.use('layer',function () {
           var layer=layui.layer;
        })
         layer.open({
             type: 2,
             skin: 'layui-layer-rim'//加上边框
             ,area: ['350px', '150px']
             ,shade: 0
             ,maxmin: true
             ,offset: 'rb'
             ,content: '/cfgjht/getMsg'
             ,zIndex: layer.zIndex //重点1
             ,success: function(layero){
             layer.setTop(layero); //重点2
         }
         });
         /!*layer.open({
             type: 1 //此处以iframe举例
             ,title: '当你选择该窗体时，即会在最顶端'
             ,area: ['350px', '150px']
             ,shade: 0
             ,maxmin: true
             ,offset: 'rb'
             ,content: "<div>OK</div>"
             ,btn: ['全部关闭'] //只是为了演示
             ,btn2: function(){
                 layer.closeAll();
             }

             ,zIndex: layer.zIndex //重点1
             ,success: function(layero){
                 layer.setTop(layero); //重点2
             }
         });*!/
 */

    }

    //关闭连接
    function closeWebSocket(){
        websocket.close();
    }
</script>
</html>